package jd;

public class ArticleId {
	public String ty;
	public String id;

	boolean inited = false;

	void init() {
		if (inited)
			return;

		if (ty == null) {
			ty = "";
		}
		ty = ty.replaceAll("'", "''");

		if (id == null) {
			id = "";
		}
		id = id.replaceAll("'", "''");

		inited = true;
	}

	public String to_str() {
		String ret;
		init();
		ret = String.format("'%s', '%s'", ty, id);
		return ret;
	}

	public String to_cond() {
		String ret;
		init();
		ret = String.format("ty='%s' AND aid='%s'", ty, id);
		return ret;
	}
}

